#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<Windows.h>

#define High 25
#define Width 50

int cells[High][Width];

int HideCursor()
{
	CONSOLE_CURSOR_INFO cursor_info = { 1,0 }; 
	SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
	return 0;
}
int gotoxy(int x, int y)
{
	HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
	COORD pos;
	pos.X = x;
	pos.Y = y;
	SetConsoleCursorPosition(handle, pos);
	return 0;
}
void startup()
{
	int i, j;
	for (i = 0; i < High; i++)
	{
		for (j = 0; j < Width; j++)
		{
			cells[i][j] = rand()%2;
		}
	}
}
int show() 
{
	gotoxy(0, 0); 
	int i,j;
	for (i = 0; i < High; i++)
	{
		for (j = 0; j < Width; j++)
		{
			if (cells[i][j] == 1)
				printf("*");
			else
				printf(" ");
		}
		printf("\n");
	} 
	return 0;
}
int updateWithoutInput()
{
	return 0;
}
int updateWithInput()
{
	return 0;
}
int main()
{
	startup();
	HideCursor();
	while(1)
	{
		show();
		updateWithInput();
		updateWithoutInput();
	}
	system("pause");
	return 0;
}
